<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<link rel="stylesheet" href="plug-in/ace2/assets/css/font-awesome.min.css" />
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="deviceTypeList" checkbox="true" fitColumns="true" title="设备入库" actionUrl="deviceTypeController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="编号"  field="no"  queryMode="single"  width="120" query="true"></t:dgCol> 
   <t:dgCol title="名称"  field="name"  queryMode="single"  width="120" query="true"></t:dgCol>
   <t:dgCol title="图片" field="id2" width="100" formatterjs="getImg"></t:dgCol> 
   <t:dgCol title="型号"  field="model"  queryMode="single"  width="120" query="false"></t:dgCol> 
   <t:dgCol title="货架号"  field="shelvesNo"  queryMode="single"  width="120" query="true"></t:dgCol> 
   <t:dgCol title="数量"  field="balance"  queryMode="single"  width="120" query="false"></t:dgCol> 
   <t:dgCol title="单位"  field="unit"  queryMode="single"  width="120" query="false"></t:dgCol> 
   <t:dgCol title="实验室"  field="lab.id"  queryMode="single" hidden="true"  width="120" query="true" replace="${labNames }"> </t:dgCol>
   <t:dgCol title="实验室"  field="labName"  queryMode="single"  width="120" query="false"> </t:dgCol>
   <t:dgCol title="所属项目"  field="teachItemName"  queryMode="single"  width="120" query="false"></t:dgCol> 
   <t:dgCol title="存放位置"  field="location"  queryMode="single"  width="100"></t:dgCol> 
   <t:dgCol title="状态"  field="state.name"    queryMode="single"  width="60" align="center"></t:dgCol>
   <t:dgCol title="所属管理员"  field="holderName"    queryMode="single"  width="80"></t:dgCol>
    <t:dgCol title="操作" field="opt" width="160"></t:dgCol>
   <t:dgDelOpt title="删除" url="deviceTypeController.do?doDel&id={id}"  exp="state.name#eq#损坏"/>
   <t:dgToolBar title="录入设备信息" icon="icon-add" url="deviceTypeController.do?goAdd" funname="add" width="900"></t:dgToolBar>
   <%-- <t:dgToolBar title="编辑" icon="icon-edit" url="deviceTypeController.do?goUpdate" funname="update" width="900"></t:dgToolBar> --%>
   <t:dgToolBar title="批量删除"  icon="icon-remove" url="deviceTypeController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="deviceTypeController.do?goUpdate" funname="detail" width="900"></t:dgToolBar>
   <t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
 <script src = "webpage/com/mengtian_tech/device_mgr/device/deviceTypeList.js"></script>		
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
		$("#deviceTypeListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
		$("#deviceTypeListtb").find("input[name='updateDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
 function getImg(id,rec){
	 return '<img style="width:80px;height:80px;" src="cms-attach.do?getByOwner&ownerId='+rec.id+'"/>' ;
 }
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'deviceTypeController.do?upload', "deviceTypeList");
}

//导出
function ExportXls() {
	JeecgExcelExport("deviceTypeController.do?exportXls","deviceTypeList");
}
 </script>